#!/bin/bash

read -p "请输入用户名" name

if id $name &> /dev/null; then
	echo "用户$name已存在"
else
	useradd $name
	read -p "请输入密码" pd
	echo "$pd" | passwd --stdin $name &>/dev/null
	echo "用户$name已创建完成"
fi

